<?php
/**
 * 活动申请
 *
 * @author Administrator
 *
 */
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ActivityType extends Model
{
    //
    protected $table = 'activity_type';

    public $timestamps = false;

    static function getType()
    {
        $types = self::where('status', 1)->get();
        $data = array();
        foreach ($types as $key => $val) {
            $data[$val->code]['id'] = $val->id;
            $data[$val->code]['code'] = $val->code;
            $data[$val->code]['name'] = $val->name;
        }

        return $data;
    }
}
